import pytest

from storage.utils import align_to


@pytest.mark.parametrize('i,alignment,expect', [
    (0, 4, 0),
    (1, 4, 4),
    (4, 4, 4),

    (5, 4, 8),
    (7, 4, 8),
    (6, 4, 8),

    (8, 4, 8),
    (9, 4, 12),
    (11, 4, 12),
])
def test_align_to(i, alignment, expect):
    assert align_to(i, alignment) == expect
